<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>命名空间</title>
</head>
<body>

</body>
<script>
    // 闭包实现命名空间
    var init = (function () {
        var name = 'user1';
        function callName(){
            console.log(name);
        }
        return function(){
            callName();
        };
    }());

    init();
</script>
</html>
